package com.miplus.ccrm.core.service.crd;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.miplus.ccrm.common.CmdResVo;
import com.miplus.ccrm.common.JPubUtils;
import com.miplus.ccrm.common.JSysUser;
import com.miplus.ccrm.common.JUsrPerm;
import com.miplus.ccrm.core.controller.vo.credit.*;
import com.miplus.ccrm.core.pojo.*;
import com.miplus.ccrm.core.mapper.FiCreditcasesHistMapper;
import com.miplus.ccrm.core.service.ExportService;
import com.miplus.ccrm.core.service.conf.SysGrpService;
import com.miplus.ccrm.core.service.strategy.CfgRuleTaskStepsService;
import com.miplus.ccrm.core.utils.EnumFiCaseHistType;
import com.miplus.ccrm.core.utils.EnumGrpType;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
* @author pc
* @description 针对表【fi_creditcases_hist(案件表)】的数据库操作Service实现
* @createDate 2024-04-02 14:40:12
*/
@Service
public class FiCreditcasesHistServiceImpl extends MPJBaseServiceImpl<FiCreditcasesHistMapper, FiCreditcasesHist>
    implements FiCreditcasesHistService{
    @Resource
    SysGrpService sysGrpService;

    @Resource
    private ExportService exportService;
    @Resource
    private FiImportHistService fiImportHistService;

    @Override
    public IPage<DistListResVo> fiCaseDistList(JSysUser user, DistListReqVo paras)
    {
        return baseMapper.quyDistBatchList(new Page<>(paras.getPageNum(), paras.getPageSize()),
                paras,user.getGroups(),user.getUsrid()
        );
    }

    @Override
    public IPage<DistListResVo> fiCaseDistBatchDetailList(DistGrpBtcTailReqVo paras)
    {
        return baseMapper.quyDistBatchTailList(new Page<>(paras.getPageNum(), paras.getPageSize()),paras);
    }

    @Override
    public IPage<DistDetailListResVo> fiCaseDistDetailList(JSysUser user, DistDetailListReqVo paras,Boolean isEncryption)
    {
        String $usrid=user.getUsrid();
        String usrgrp=user.getGroups();
        SysGrp grp = sysGrpService.getById(usrgrp);
        if( grp.getType() == EnumGrpType.TEAM.value)
            usrgrp = grp.getParentid();
        //2024-08-18 add and fh.distdt=fc.distdt 条件及fi.repay
        boolean viewAllCase= JUsrPerm.viewAllFiCase(user);
        //数据库尽量不要使用函数，否则慢,尤其TDSQL
        //.apply("fi_hasFiCaseView({0},t.creditcaseid,t.status,t.sendtodept,t.sendtousr)>0", $usrid)
        //      log.info("getQueryWrapper:viewAllCase={},iscock={}",viewAllCase,iscock);
        boolean viewGrpFiCase = false;
        if(!viewAllCase && user.getMgrgrplist().size()>0)
            viewGrpFiCase = true;


        String phnstar= "1";
        String idstar= "1";

        if(isEncryption){
            phnstar= JUsrPerm.getPermission(user,JUsrPerm.DISSTAR_PHN);
            idstar= JUsrPerm.getPermission(user,JUsrPerm.DISSTAR_IDNO);
        }

        List<Integer> distHistIds = new ArrayList<>();
        IPage<DistDetailListResVo> distDetailListResVoPage =  selectJoinListPage(new Page<>(paras.getPageNum(), paras.getPageSize()),
                DistDetailListResVo.class,
                new MPJLambdaWrapper<FiCreditcasesHist>()
//                        .distinct()
                        .selectAs("g.grpname", DistDetailListResVo::getGrpname)
//                        .selectAs("fun_getnames('PUBLIC.MORAUTO',t.distributetype)", DistDetailListResVo::getDisttypedsc)
//                        .selectAs("fun_getnames('SORTING.QUEUE',t.disttag)", CrdCaseResVo::getDisttag)
//                        .selectAs("fun_getnames('COLLECT.STATUS',(case when fh.status is NULL then t.status else fh.status end))", DistDetailListResVo::getStatusdsc)
//                        .selectAs("fh.recycledt",DistDetailListResVo::getRecycledt)
//                        .selectAs("fh.recycledsc",DistDetailListResVo::getRecycledsc)
//                        .selectAs("fh.overdue_totalamt",DistDetailListResVo::getRetOverdueTotalamt)
//                        .selectAs("fh.pre_repay_principal ",DistDetailListResVo::getRetPreRepayPrincipal)
//                        .selectAs("fh.pre_repay_interest",DistDetailListResVo::getRetPreRepayInterest)
//                        .selectAs("fh.pre_overdue_fee",DistDetailListResVo::getRetPreOverdueFee)
//                        .selectAs("fh.pre_repay_fee",DistDetailListResVo::getRetPreRepayFee)
//                        .selectAs("fh.mths_day",DistDetailListResVo::getRetMthsDay)
//                        .selectAs("fh.overdue_stage",DistDetailListResVo::getRetOverdueStage)
//                        .selectAs("fh.repaid_amount",DistDetailListResVo::getRepaidAmount)
//                        .selectAs("fhc.closedt",DistDetailListResVo::getClosedt)
//                        .selectAs("dbh.batchname",DistDetailListResVo::getDistbatchname)
//                        .selectAs(CfgRuleTaskSteps::getRuleStepName,DistDetailListResVo::getDistributorname)
//                        .selectAs("fun_getnames('PRODUCT.TYPE',t.prodtype)", DistDetailListResVo::getProdTypeDsc)
//                        .leftJoin(FiDistbatchHist.class,"dbh",FiDistbatchHist::getBatchid,FiCreditcasesHist::getDistbatchid)
//                        .leftJoin(CfgRuleTaskSteps.class,"cts",CfgRuleTaskSteps::getRuleStepId,FiCreditcasesHist::getDistributorid)
//                        .leftJoin("fi_creditcases_hist fh on fh.creditcaseid=t.creditcaseid and fh.distbatchid=t.distbatchid and fh.actiontype =3 ")
//                        .leftJoin("fi_creditcases_hist fhc on fhc.creditcaseid=t.creditcaseid and fhc.distbatchid=t.distbatchid and fhc.actiontype = 4")
//                        .leftJoin(FiCreditcases.class,"fi",FiCreditcases::getCreditcaseid,FiCreditcasesHist::getCreditcaseid)
                        .leftJoin(SysGrp.class,"g",SysGrp::getGrpid,FiCreditcasesHist::getSendtodept)
                        .leftJoin(ConCustomer.class,"cu",ConCustomer::getCustomernumber,FiCreditcasesHist::getCustomernumber)
                        .leftJoin("iou_product pr on pr.product_id = t.product_id and ifnull(pr.merchant_id,'') = ifnull(t.merchant_id,'')")

                        .selectAll(FiCreditcasesHist.class)
//                        .eq(FiCreditcasesHist::getStatus,1)
                        .in(viewGrpFiCase,FiCreditcasesHist::getSendtodept,user.getMgrgrplist())
                        .eq(!viewAllCase && !viewGrpFiCase,FiCreditcasesHist::getSendtousr,$usrid)
//                        .selectAs("fun_getnames('COLLECT.QUEUE',t.ccc)", CrdCaseResVo::getCccdsc)
//                        .select(FiDistbatchHist::getBinddays)
//                        .apply("(case when t.distributetype=2 then dbh.actiondt=t.distdt else 1=1 end)")
                        //.apply(JPubUtils.IsNotEmpty(paras.getStatus()),"(case when fh.status is NULL then t.status={0} else fh.status={0} end)",paras.getStatus())
                        .eq(JPubUtils.IsNotEmpty(paras.getStatus()),FiCreditcasesHist::getStatus,paras.getStatus())
                        .eq(JPubUtils.IsNotEmpty(paras.getProdtype()), FiCreditcasesHist::getProdtype, paras.getProdtype())
                        .eq(JPubUtils.IsNotEmpty(paras.getFicaseid()),FiCreditcasesHist::getCreditcaseid,paras.getFicaseid())
                        .eq(JPubUtils.IsNotEmpty(paras.getDistbatchid()),FiCreditcasesHist::getDistbatchid,paras.getDistbatchid())
                        .in(ObjectUtils.isNotEmpty(paras.getGrpid()),FiCreditcasesHist::getSendtodept,paras.getGrpid())

                        .ge(JPubUtils.IsNotEmpty(paras.getStartdt()),FiCreditcasesHist::getDistdt,paras.getStartdt())
                        .le(JPubUtils.IsNotEmpty(paras.getEnddt()),FiCreditcasesHist::getDistdt,paras.getEnddt())
                        .ge(JPubUtils.IsNotEmpty(paras.getRecydt1()),FiCreditcasesHist::getBindenddt,paras.getRecydt1())
                        .le(JPubUtils.IsNotEmpty(paras.getRecydt2()),FiCreditcasesHist::getBindenddt,paras.getRecydt2())
                        .ge(JPubUtils.IsNotEmpty(paras.getReturndt1()),FiCreditcasesHist::getRecycledt,paras.getReturndt1())
                        .le(JPubUtils.IsNotEmpty(paras.getReturndt2()),FiCreditcasesHist::getRecycledt,paras.getReturndt2())
                        .eq(JPubUtils.IsNotEmpty(paras.getGrptype()),SysGrp::getType,paras.getGrptype())


                        .eq(JPubUtils.IsNotEmpty(paras.getCustomernumber()),FiCreditcasesHist::getCustomernumber,paras.getCustomernumber())
                        .eq(JPubUtils.IsNotEmpty(paras.getCustname()),ConCustomer::getCustname,paras.getCustname())
                        .eq(JPubUtils.IsNotEmpty(paras.getOpenacctcertno()),ConCustomer::getOpenacctcertno,paras.getOpenacctcertno())
                        .eq(JPubUtils.IsNotEmpty(paras.getMobile()),ConCustomer::getMobile,paras.getMobile())
                        .eq(JPubUtils.IsNotEmpty(paras.getRecycledsc()),FiCreditcasesHist::getRecycledsc,paras.getRecycledsc())
                        .in(ObjectUtils.isNotEmpty(paras.getSendtousr()),FiCreditcasesHist::getSendtousr,paras.getSendtousr())
                        .in(ObjectUtils.isNotEmpty(paras.getDisttag()),FiCreditcasesHist::getDisttag,paras.getDisttag())
                        .in(ObjectUtils.isNotEmpty(paras.getDistusr()),FiCreditcasesHist::getDistusr,paras.getDistusr())
                        .in(ObjectUtils.isNotEmpty(paras.getDistributorid()),FiCreditcasesHist::getDistributorid,paras.getDistributorid())
                        .in(ObjectUtils.isNotEmpty(paras.getActiontype()),FiCreditcasesHist::getActiontype,paras.getActiontype())
                        .in(JPubUtils.IsNotEmpty(paras.getPrductIdList()), "pr.id", paras.getPrductIdList())//产品列表主键 ID

                        .ge(JPubUtils.IsNotEmpty(paras.getCpOverdueDays1()),FiCreditcasesHist::getMthsDay,paras.getCpOverdueDays1())
                        .le(JPubUtils.IsNotEmpty(paras.getCpOverdueDays2()),FiCreditcasesHist::getMthsDay,paras.getCpOverdueDays2())
                        .ge(JPubUtils.IsNotEmpty(paras.getCpStartTime1()),FiCreditcasesHist::getCpStartTime,paras.getCpStartTime1())
                        .le(JPubUtils.IsNotEmpty(paras.getCpStartTime2()),FiCreditcasesHist::getCpStartTime,paras.getCpStartTime2())
                        .ge(JPubUtils.IsNotEmpty(paras.getInstartdt()),FiCreditcasesHist::getIndt,paras.getInstartdt())
                        .le(JPubUtils.IsNotEmpty(paras.getInenddt()),FiCreditcasesHist::getIndt,paras.getInenddt())
                        .ge(JPubUtils.IsNotEmpty(paras.getRecystartdt()),FiCreditcasesHist::getRecycledt,paras.getRecystartdt())
                        .le(JPubUtils.IsNotEmpty(paras.getRecyenddt()),FiCreditcasesHist::getRecycledt,paras.getRecyenddt())
                        .ge(JPubUtils.IsNotEmpty(paras.getActualDuration1()),"DATEDIFF(t.recycledt,t.cp_start_time)",paras.getActualDuration1())
                        .le(JPubUtils.IsNotEmpty(paras.getActualDuration2()),"DATEDIFF(t.recycledt,t.cp_start_time)",paras.getActualDuration2())

                        .exists(ObjectUtils.isNotEmpty(paras.getLoanInvoiceId()),String.format("SELECT 1 from iou_loan_invoice_info il WHERE il.creditcaseid=t.creditcaseid AND il.loan_invoice_id = ('%s')",paras.getLoanInvoiceId()))
                        .orderBy(JPubUtils.IsNotEmpty(paras.getColumn()),paras.getIsASC(),getColumn(paras.getColumn()))
                        .orderByDesc(JPubUtils.IsEmpty(paras.getColumn()),FiCreditcasesHist::getHistid)

        ).convert(x->{
            //x.setActiontypeDsc(EnumFiCaseHistType.getDescByCode(x.getActiontype()));
            distHistIds.add(x.getHistid());
            return x;
        });
        if( distHistIds.size() >0 ) {
            //目前 batchhist表的batchid不唯一，不能和batchhist关联。
            Map<Integer, DistDetailListResVo> caseHistList =  selectJoinList( DistDetailListResVo.class, new MPJLambdaWrapper<FiCreditcasesHist>()
//                    .leftJoin(" ( select creditcaseid, distbatchid, SUBSTRING_INDEX(GROUP_CONCAT(histid ORDER BY histid DESC ),',',1) histid " +
//                            " from fi_creditcases_hist where status='3' group by creditcaseid, distbatchid ) fchl on fchl.creditcaseid = t.creditcaseid and fchl.distbatchid = t.distbatchid" )
//                    .leftJoin( " fi_creditcases_hist fch on fch.histid = fchl.histid")
//                    .leftJoin(" ( select creditcaseid, distbatchid, SUBSTRING_INDEX(GROUP_CONCAT(histid ORDER BY histid DESC ),',',1) histid " +
//                            " from fi_creditcases_hist where status='9' group by creditcaseid, distbatchid ) fccl on fccl.creditcaseid = t.creditcaseid and fccl.distbatchid = t.distbatchid" )
//                    .leftJoin( " fi_creditcases_hist fcc on fcc.histid = fccl.histid")
//                    //.leftJoin(FiDistbatchHist.class,"dbh",FiDistbatchHist::getBatchid,FiCreditcasesHist::getDistbatchid)
                    .leftJoin(CfgRuleTaskSteps.class,"cts",CfgRuleTaskSteps::getRuleStepId,FiCreditcasesHist::getDistributorid)
                    .leftJoin(ConCustomer.class,"cu",ConCustomer::getCustomernumber,FiCreditcasesHist::getCustomernumber)

                    .selectAs(String.format("fi_starSecu('%s','%s',cu.mobile,'%s')", $usrid, JUsrPerm.DISSTAR_PHN, phnstar), DistDetailListResVo::getMobile)
                    .selectAs(String.format("fi_starSecu('%s','%s',cu.openacctcertno,'%s')", $usrid, JUsrPerm.DISSTAR_IDNO, idstar), DistDetailListResVo::getOpenacctcertno)
                    .selectAs(FiCreditcasesHist::getHistid, DistDetailListResVo::getHistid)
                    .selectAs(ConCustomer::getCustname, DistDetailListResVo::getCustname)
                    .selectAs("fun_getnames('PUBLIC.MORAUTO',t.distributetype)", DistDetailListResVo::getDisttypedsc)
                    .selectAs("fun_getnames('SORTING.QUEUE',t.disttag)", DistDetailListResVo::getDisttag)
                    .selectAs("fun_getnames('COLLECT.STATUS',t.status)", DistDetailListResVo::getStatusdsc)
                    .selectAs("fun_getnames('COLLECT.HIST.ACTIONTYPE',t.actiontype)", DistDetailListResVo::getActiontypeDsc)
//
//                    .selectAs("fun_getnames('COLLECT.STATUS',ifnull(fcc.status,ifnull(fch.status,t.status)))", DistDetailListResVo::getStatusdsc)
//                    .selectAs("fch.recycledt",DistDetailListResVo::getRecycledt)
//                    .selectAs("fch.recycledsc",DistDetailListResVo::getRecycledsc)
//                    .selectAs("fch.overdue_totalamt",DistDetailListResVo::getRetOverdueTotalamt)
//                    .selectAs("fch.pre_repay_principal ",DistDetailListResVo::getRetPreRepayPrincipal)
//                    .selectAs("fch.pre_repay_interest",DistDetailListResVo::getRetPreRepayInterest)
//                    .selectAs("fch.pre_overdue_fee",DistDetailListResVo::getRetPreOverdueFee)
//                    .selectAs("fch.pre_repay_fee",DistDetailListResVo::getRetPreRepayFee)
//                    .selectAs("fch.mths_day",DistDetailListResVo::getRetMthsDay)
//                    .selectAs("fch.overdue_stage",DistDetailListResVo::getRetOverdueStage)
//                    .selectAs("fch.repaid_amount",DistDetailListResVo::getRepaidAmount)
//                    .selectAs("fcc.closedt",DistDetailListResVo::getClosedt)
                    .selectAs("t.distbatchid",DistDetailListResVo::getDistbatchname)
                    .selectAs(CfgRuleTaskSteps::getRuleStepName,DistDetailListResVo::getDistributorname)
                    .selectAs("fun_getnames('PRODUCT.TYPE',t.prodtype)", DistDetailListResVo::getProdTypeDsc)
                    .selectAs("fun_getnames('COLLECT.QUEUE',t.ccc)", DistDetailListResVo::getCccdsc)
                    .selectAs("datediff(t.cp_end_time, t.cp_start_time)",DistDetailListResVo::getBinddays)
                    .selectAs("datediff(t.recycledt,t.cp_start_time)",DistDetailListResVo::getActualDuration)
                    .in(FiCreditcasesHist::getHistid,distHistIds)

            ).stream().collect(Collectors.toMap(item -> item.getHistid(), item -> item));

            distDetailListResVoPage.convert(x->{
                x.setDisttypedsc(caseHistList.get(x.getHistid()).getDisttypedsc());
                x.setDisttag(caseHistList.get(x.getHistid()).getDisttag());
                x.setStatusdsc(caseHistList.get(x.getHistid()).getStatusdsc());
                x.setActiontypeDsc(caseHistList.get(x.getHistid()).getActiontypeDsc());
                x.setMobile(caseHistList.get(x.getHistid()).getMobile());
                x.setOpenacctcertno(caseHistList.get(x.getHistid()).getOpenacctcertno());
                x.setCustname(caseHistList.get(x.getHistid()).getCustname());
//                x.setRecycledt(caseHistList.get(x.getHistid()).getRecycledt());
//                x.setRecycledsc(caseHistList.get(x.getHistid()).getRecycledsc());
//                x.setRetOverdueTotalamt(caseHistList.get(x.getHistid()).getRetOverdueTotalamt());
//                x.setRetPreRepayPrincipal(caseHistList.get(x.getHistid()).getRetPreRepayPrincipal());
//                x.setRetPreRepayInterest(caseHistList.get(x.getHistid()).getRetPreRepayInterest());
//                x.setRetPreOverdueFee(caseHistList.get(x.getHistid()).getRetPreOverdueFee());
//                x.setRetPreRepayFee(caseHistList.get(x.getHistid()).getRetPreRepayFee());
//                x.setRetMthsDay(caseHistList.get(x.getHistid()).getRetMthsDay());
//                x.setRetOverdueStage(caseHistList.get(x.getHistid()).getRetOverdueStage());
//                x.setRepaidAmount(caseHistList.get(x.getHistid()).getRepaidAmount());
//                x.setClosedt(caseHistList.get(x.getHistid()).getClosedt());
                x.setDistbatchname(caseHistList.get(x.getHistid()).getDistbatchname());
                x.setDistributorname(caseHistList.get(x.getHistid()).getDistributorname());
                x.setProdTypeDsc(caseHistList.get(x.getHistid()).getProdTypeDsc());
                x.setCccdsc(caseHistList.get(x.getHistid()).getCccdsc());
                x.setBinddays(caseHistList.get(x.getHistid()).getBinddays());
                x.setActualDuration(caseHistList.get(x.getHistid()).getActualDuration());
                return x;
            });
        }
        //这个会很慢在TDSQL
        //.orderByDesc("t.distdt")
        return distDetailListResVoPage;
    }

    @Override
    public CmdResVo expCaseDistDetailList(JSysUser user, DistDetailListReqVo paras, HttpServletResponse response) {
        String $usrid=user.getUsrid();

        IPage<DistDetailListResVo> pages = fiCaseDistDetailList(user, paras,false);
        ArrayList arr=new ArrayList();

        String exptempid=JPubUtils.getExpTempID(paras.getExpfilename(),"分案明细报表");
        String filename=JPubUtils.getExpFileName(
                paras.getExpfilename(),exptempid
        );

        pages.convert(u->{
            HashMap map=JPubUtils.toExportMap(u);
            if(map!=null) arr.add(map);
            return u;
        });
        CmdResVo resVo=exportService.ToExcel(
                response,
                arr,
                paras.getExpidlist(),
                paras.getExpnamelist(),
                filename,
                $usrid
        );

        int okcount=resVo.getCount();
        if(okcount>0){
            fiImportHistService.AddExportHist(
                    resVo.getKeyId(),
                    $usrid,
                    exptempid,
                    filename,
                    okcount
            );
        }

        return resVo;
    }

    // 排序字段转换
    private String getColumn(String column){
        if(JPubUtils.IsEmpty(column)) {
            return column;
        }
        switch (column){
            case "histid":
                column="t.histid";
                break;
            case "distdt":
                column="t.distdt";
                break;
            case "cpStartTime":
                column="t.cp_start_time";
                break;
            case "cpEndTime":
                column="t.cp_end_time";
                break;
            case "recycledt":
                column = "t.recycledt";
                break;
        }
        return column;
    }
    @Override
    public IPage<CommisResVo> crdCommisList(JSysUser user, CommisReqVo paras)
    {
        //佣金计算时，银行主动划扣的款项不计入佣金计算。最终佣金要扣除扣罚项总金额。
        String $usrid=user.getUsrid();
        String usrgrp=user.getGroups();
        return selectJoinListPage(new Page<>(paras.getPageNum(), paras.getPageSize()),
                CommisResVo.class,
                new MPJLambdaWrapper<FiCreditcasesHist>()
                        .selectSum(FiCreditcasesHist::getOdudPrin,CommisResVo::getDistprin)
                        .selectCount(FiCreditcasesHist::getDistbatchid,CommisResVo::getDistnum)
                        .selectAs("(select g.grpname from sys_grp g where g.grpid=t.sendtodept)",CommisResVo::getGrpname)
                        .selectAs("sum(case when fh.repay is null then 0.0 else fh.repay end)",CommisResVo::getCollectprin)
                        .selectAs("sum(case when fh.repay>0.0 then 1 else 0 end)",CommisResVo::getCollectnum)
                        .leftJoin("fi_creditcases_hist fh on fh.creditcaseid=t.creditcaseid and fh.distbatchid=t.distbatchid and fh.status in(3,4,9)")
                        .select(FiCreditcasesHist::getDistbatchid,FiCreditcasesHist::getSendtodept)
                        .eq(FiCreditcasesHist::getStatus,1)
                        .apply("fc_hasDistInMgr(t.sendtodept,{0},{1})>0",usrgrp,$usrid)
                        .exists("select 1 from  sys_grp g where g.type=5 and g.grpid=t.sendtodept")
                        .eq(JPubUtils.IsNotEmpty(paras.getDistbatchid()),FiCreditcasesHist::getDistbatchid,paras.getDistbatchid())
                        .eq(JPubUtils.IsNotEmpty(paras.getGrpid()),FiCreditcasesHist::getSendtodept,paras.getGrpid())
                        .groupBy(FiCreditcasesHist::getDistbatchid,FiCreditcasesHist::getSendtodept)
                        .orderByAsc(FiCreditcasesHist::getDistbatchid,FiCreditcasesHist::getSendtodept)
        );
    }

    @Override
    public IPage<CommisResVo> fiCommisList(JSysUser user, CommisReqVo paras)
    {
        return baseMapper.quyCommisList(new Page<>(paras.getPageNum(), paras.getPageSize()),paras);
    }
}




